package com.geopg;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class HelloWorldActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    
        
        Button b1 = (Button) findViewById(R.id.button1);
        b1.setOnClickListener(new View.OnClickListener() {

			
			
			public void onClick(View v) {
				Double d = (Double) (Math.random()*5);
				
				
				
				
				
				TextView tv = (TextView) findViewById(R.id.textview);
				int x = d.intValue();
				String s = null;
				/*
				if(x==1){
					s= "a";
				}else if(x==2){
					s="b";
				}else if(x==3){
					s="c";
				}else if(x==4){
					s="d";
				}else if(x==5){
					s="e";
				}
				*/
				
				switch (x){
				case 0: s="ZERO";break;
				case 1: s="A";break;
				case 2: s="B";break;
				case 3: s="C";break;
				case 4: s="D";break;
				case 5: s="E";break;
				default: s="Hello Again";break;
				}
				
				tv.setText(s);
			}
		});
        
        
        
        Button b2 = (Button) findViewById(R.id.button2);
        b2.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
			
			gallery();
			
				
			}

			
		});
        
        Button b3 = (Button) findViewById(R.id.button3);
        b3.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				camera();
			}

		});
    
    
    
    }
    private void gallery() {
    	Intent gallery = new Intent(this, Gallery.class);
		startActivity(gallery);
			}
    

	private void camera() {
		Intent camera = new Intent(this, Camera.class);
		startActivity(camera);
		
	}
   
}